/**
 * 
 */
package it.unical.canonaco.rende.igpe.game.cbv.guilayer.match.components;

import java.awt.CardLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Map;

import it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites.SpriteSheetCache;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.actions.MovementAction;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.component.pawn.Character;
import it.unical.canonaco.rende.igpe.game.cbv.logiclayer.engine.component.pawn.GenericPawn;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.plaf.basic.BasicInternalFrameTitlePane.MoveAction;

/**
 * @author Massimo Canonaco
 *
 */
class CharacterStatusPanel016 extends JPanel 
{

//	private GenericPawn actualCharacter;
	
	private CharacterInformationContainerPanel016 cicp;
	
	private CardLayout layout;
	
	private AttackInformationPanel016 attackPanel;
	
	private BaseInformationPanel016 basePanel;
	
//	private JButton
	public CharacterStatusPanel016(CharacterInformationContainerPanel016 monitor, Map<String, String> settings, SpriteSheetCache imgCache) 
	{
		super();
		cicp = monitor;
		layout = new CardLayout();
		setLayout(layout);
		setOpaque(false);
		attackPanel = new AttackInformationPanel016(this, settings, imgCache);
		basePanel = new BaseInformationPanel016(this,settings);
		
		this.add(attackPanel,AttackInformationPanel016.NAME);
		this.add(basePanel,BaseInformationPanel016.NAME);
	}

	/**
	 * @return the cicp
	 */
	public CharacterInformationContainerPanel016 getCicp() 
	{
		return cicp;
	}
	
	
	/** */
	public AttackInformationPanel016 showAttackPanel()
	{
		attackPanel.updateLabels((Character)cicp.getActualCharacter()); 
		layout.show(this, AttackInformationPanel016.NAME);
		return attackPanel;
	}
	
	/** */
	public BaseInformationPanel016 showBasePanel()
	{
		layout.show(this, BaseInformationPanel016.NAME);
		return basePanel;
	}

	public void on() 
	{
		basePanel.enableComponents();
	}

	public void off() 
	{
		showBasePanel().disableComponents();
	}

	/**
	 * @return the attackPanel
	 */
	public AttackInformationPanel016 getAttackPanel() {
		return attackPanel;
	}
}
